﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PersonPointView.aspx.cs" Inherits="JKF.Web.Point_Log.PersonPointView" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
        <%= RegScript("~/js/jquery.1.5.js")%>
        <%=RegScript("~/js/Common.js")%>
        <%=RegScript("~/js/jquery.json.js")%>
        <%=RegScript("~/js/jquery.nhis.js")%>
        <%=RegScript("~/js/jquery.rchis.js")%>
        <%=RegScript("~/js/jquery.validate.js")%>
        <%=RegScript("~/js/DatePicker/WdatePicker.js")%>
        <%=RegStyle("~/js/suggest/jquery.suggest.css")%>
        <%= RegScript("~/js/jquery-ui-custom.min.js")%>
    <script src="../../js/Uppop/tipswindown2.js"  type="text/javascript"></script>
        
    <link href="../../App_Themes/Theme2/Include.css"   rel="stylesheet" type="text/css" />  
    
    <script type="text/javascript" language="javascript">
        var isView = '<%=IsView%>'; //是否有浏览权限
        var isDelete = '<%=IsDelete%>' == 'True' ? '' : 'none'; // 是否具有删除权限

        var AppPath = '<%=AppPath %>';
        var handler = AppPath + '/do/Points/Point_Log.do';
        var customerKey = '<%=P("customerKey") %>'; //人员主键

        $(function () {
            bindPointLog();
        });

        function bindPointLog() {
            var tbody = $('#tb tbody');
            tbody.empty();

            $.ajax({ global: true, url: handler, data: { ActionName: "GetPointLogByPerson", customerKey: customerKey }, success: function (data) {
                if (data.error == true) {
                    ShowWarn(data.message);
                }
                else {
                    var j = 0;
                    $.each(data.Tables[0].Rows, function (i, dr) {
                        tr = $("<tr key=" + dr.POINT_KEY + "></tr>").appendTo(tbody);
                        $('<td width="90px"></td>').appendTo(tr).html('<input type="button" class="common_btn_del mr12"  style="display:' + isDelete + '" onclick="delPointLog(' + "'" + dr.POINT_KEY + "'" + ')">');
                        $('<td width="80px"></td>').appendTo(tr).text(dr.CARD_NO);
                        $('<td  width="100px"></td>').appendTo(tr).text(dr.NAME);
                        $('<td width="60px"></td>').appendTo(tr).text(dr.PONT_TYPE);
                        $('<td width="120px"></td>').appendTo(tr).text(dr.WAY);
                        $('<td width="80px"></td>').appendTo(tr).text(dr.POINT_VALUE);
                        $('<td width="110px"></td>').appendTo(tr).text(dr.POINT_TIME);
                        $('<td  width="80px"></td>').appendTo(tr).text(dr.MEMO);
                        $('<td width="80px"></td>').appendTo(tr).text(dr.ACCOUNT);
                        j = i;
                    })

                    $("#lblRecordCount").text(j);
                }
            }, dataType: "json", type: "POST", async: true
            });
    }

    function delPointLog(pointKeyKey) {
        if (!confirm("确认删除吗?"))
            return false;

        $.post(handler, { ActionName: "DeletePointLog", pointKey: pointKeyKey },
                   function (rslt) {
                       if (rslt.MessageCode == "Ok") {
                           $("tr[key='" + pointKeyKey + "']").remove();
                           $("#lblRecordCount").text(parseInt($("#lblRecordCount").text())-1);
                           alert("删除成功."); return;
                       }
                   }
                , "json");
    }
    </script>  
</head>
<body id="modulebody">
      <div class="index_table">
        <div >
            <table border="0" cellspacing="0" cellpadding="0"  width="800" class="common_table">
                <thead>
                    <tr>
                        <th width="90px" ordertype="string">操作</th>
                        <th width="80px"  ordertype="string">卡号</th>
                        <th width="100px" ordertype="string">姓名</th>
                        <th width="60px"  ordertype="string">积分类型</th>
                        <th width="120px" ordertype="string">积分途径</th>
                        <th width="80px"  ordertype="string">积分值</th>
                        <th width="110px"  ordertype="string">积分时间</th>
                        <th width="80px"  ordertype="string">备注</th>
                        <th width="80px"  ordertype="string">操作员</th>
                    </tr>
                </thead>
            </table>
            <div style="width:800px;height:450px;overflow:auto;overflow-x:hidden;">
                <table id="tb" width="800" border="0" cellspacing="0" cellpadding="0"  class="common_table">
                  <tbody>
                       <tr>
                        <td colspan="9" style="text-align: center">暂无数据</td>
                       </tr>
                  </tbody>
                </table>
            </div>
        </div>
    </div>

    <div id="divPager" class="page" style=" text-align:center">
      <span>共<LABEL id=lblRecordCount>0</LABEL>条</span>
    </div>
    </body>
</html>